import os
import signal
import time

import subprocess

cmd = 'python first.py'
process = subprocess.Popen(cmd, shell=True)
print(process.pid)
time.sleep(5)
print("停止")
subprocess.Popen("TASKKILL /F /PID {} /T".format(process.pid))
print("cmd关闭")
time.sleep(10000)